var plugin = requirePlugin("WechatSI")  
let manager = plugin.getRecordRecognitionManager();
	
class wechatSI{
	
	skvido(contentData){
		return new Promise((resolve, reject) => {
			let _this=this;
			plugin.textToSpeech({
				lang: "zh_CN",
				tts: true,
				content: contentData,
				success: function(res) {
					// console.log("succ tts", res.filename)   
					let music = null;
						music = uni.createInnerAudioContext(); //创建播放器对象
						music.src = res.filename;
						music.play(); //执行播放
						music.onEnded(() => {
							//播放结束
							music = null;
							resolve()
						});
				},
				fail: function(res) {
					reject(res)
					// console.log("fail tts", res)
				}
			})
		})
	}
}
export default new wechatSI();